﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.DemiLib;
using DG.Tweening;
using HighlightingSystem;

public class CursorMoveIn : MonoBehaviour
{
	public Camera mainCamera;
	public GameObject[] objs;
	private Highlighter hight;
	
	protected void Awake()
	{
		hight = GetComponent<Highlighter>();
		objs = GameObject.FindGameObjectsWithTag("Build");
	}

	protected void OnMouseDown()
	{
		
		for (int i = 0; i < objs.Length; i++) {
			objs[i].GetComponent<Highlighter>().tween = false;
		}
		
		hight.tween = false;
		
		mainCamera.transform.DOMove(transform.position + new Vector3(0,2,24),1f);
		mainCamera.transform.DORotate(new Vector3(4,180,0),1f);
	}
}
